1. back up iptables # cp/etc/sysconfig/iptables/var/tmp first. Port 80 must be enabled, and the following three lines of IP address and Lan must be specified: first, disable all port 80 and enable port 80 at the end of the ip segment 192.168.1.0/24.
Need to open port 80, specify IP and LAN
The following three lines mean:
Shut down all 80 ports first.
Open 80 ports of IP segment 192.168.1.0/24 end
Open IP Segment 211.123.16.123/24 80 port IP Segment
# iptables-i input-p TCP--dport 80-j DROP
1 iptables good script (reference)
Quote:
[Root @ server ~] # Cat/opt/iptables. Rule
#! /Bin/bash
#
# The interface that connect Internet
Extif = "ppp0"
# The inside interface. If you don't have this one
# And you must let this be black ex> inif = ""
Under Linux How to modify iptables open 80 port recently in the environment of the local server, found that the site localhost can access the normal, with IP access can not access, often using CentOS friends, you may encounter the same problems
1. Show the status of the firewallRun the following command with root privileges:
# iptables-l-n-v
Parameter description:
-L: Lists the rules.
-V: Displays detailed information. This option displays the interface name,
Friends who often use CentOS may encounter the same problems as me. The firewall is turned on and the 80 port is inaccessible, and the friend who just started learning CentOS can refer to it.Friends who often use CentOS may encounter the same
Install iptables Firewall
If you do not install iptables you need to install first, CentOS execution:
Yum Install Iptables
Debian/ubuntu Execution:
Apt-get Install Iptables
On the VPS on the week nine Iptables set to:
*nat:P rerouting ACCEPT [7
Iptables official website: Alibaba
IptablesHttp://netfilter.org/
Path of the data packet passing through the firewall
Port prohibited
Force access to a site
Publish an internal network server
Intelligent DNS
Port ing
Access through NAT
Save and
If there are many ports and are sorted, use the port range statement. for example, Port 40100: 40109 indicates port 40100 to Port 40109. if you do not know the basic knowledge of IPTABLES, we recommend that you first check it out. configure a filter
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.